package com.newlink.building.login.mvp.presenter

import com.newlink.building.login.mvp.contract.Module_Login_InputMobileContract
import com.newlink.building.login.mvp.model.Module_Login_InputMobileModel
import com.newlink.building.common_base.base.BasePresenter
import com.newlink.building.common_base.ext.ss
import com.newlink.building.common_base.model.bean.VerifyCodeRequest
import com.newlink.building.common_base.utils.NLog
import com.newlink.building.common_base.utils.logDebug

/**
 * @Author: Jake
 * @Date: 2023-04-06
 * @Description:
 */
class Module_Login_InputMobilePresenter : BasePresenter<Module_Login_InputMobileContract.Model, Module_Login_InputMobileContract.View>(),
    Module_Login_InputMobileContract.Presenter {

    override fun createModel(): Module_Login_InputMobileContract.Model = Module_Login_InputMobileModel()

    override fun sendSMS(request: VerifyCodeRequest) {
        mModel?.sendSMS(request)?.ss(mModel, mView) { response ->
            logDebug<Module_Login_InputMobilePresenter>("jake.------sendSMS response---------$response")
            NLog.e("sendSMS >>>  : $response")
            response?.also {
                mView?.sendSMSSusscess(it.code == 200)
            }
        }
    }
}